<?php /*a:2:{s:43:"D:\www\long_shop\app\view\user\aboutme.html";i:1702389679;s:42:"D:\www\long_shop\app\view\common\head.html";i:1702389678;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/jquery/jquery-1.12.4.min.js"></script>    
    <link href="/static/bst5.3.2/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/bst5.3.2/js/bootstrap.bundle.min.js"></script>
    <link rel="stylesheet" href="/static/bst-icons/font/bootstrap-icons.css">
    <script src="/static/layer/layer/layer.js"></script>
    <link rel="stylesheet" href="/static/css/my.css">    
</head>
<head>
<title>我的资料</title>


</head>
<body style="width:600px;margin:0 auto;">
  <h2 class="text-center">我的资料</h2>
  <div class="container d-grid">
    <input type="hidden" name="id" id="id" value="<?php echo htmlentities($data['id']); ?>" />
    <div class="mb-3 mt-3">
      <lable for="name" class="form-label">登录账号:</label>
      <input type="text" class="form-control" id="uid" name="uid" value="<?php echo htmlentities($data['uid']); ?>"  />
    </div>
    <div class="mb-3">
      <label for="name" class="form-label">姓名:</label>
      <input type="text" class="form-control" id="name" name="name" value="<?php echo htmlentities($data['name']); ?>"   />
    </div>
    <div class="mb-3">
      <label for="address" class="form-label">地址:</label>
      <input type="text" class="form-control" id="address" name="address" value="<?php echo htmlentities($data['address']); ?>" placeholder="" />
    </div>
    <div class="mb-3">
      <label for="mobile" class="form-label">手机号码:</label>
      <input type="text" class="form-control" id="mobile" name="mobile" value="<?php echo htmlentities($data['mobile']); ?>" placeholder="" />
    </div>   
    
    <div class="mb-3">
      <label for="password" class="form-label">密码:</label>
      <input type="password" class="form-control" id="password" name="password" value="" placeholder="密码" />
      <input type="password" class="form-control" id="password2" name="password2" value="" placeholder="确认密码" style="margin-top:5px;" />
    </div>
    <button type="button" class="btn btn-primary" id="save">保存(Save)</button>
  </div>

<script type="text/javascript">
$(document).ready(function(){

  $("#save").on('click',function(){
      var id=$("#id").val();
      var uid=$("#uid").val();
      var name = $("#name").val();
      var mobile = $("#mobile").val();

      var password = $("#password").val();
      var password2 = $("#password2").val();
      if(!password || !password2 || password!=password2) {
        layer.msg('请输入两次同样的新密码！');
        return false;
      }

      //询问框
      layer.confirm('是否确定保存?', {
        btn: ['是的','不'] //按钮
      }, function(){
        //$('form').submit();

        $.ajax({
          url:'/index.php/user/aboutme',
          data:{'id':id,'uid':uid,'name':name,'mobile':mobile,'password':password},
          success:function(res){
            if(res.code){
              layer.msg(res.msg);
            }
          }
        })
      }, function(){
        layer.msg("Cancel!");
        return 0;
      });

  })

})



</script>


</body>
</html>
